Skip to content

Feature/populate materailized view#103

Merged
lpi-tn merged 5 commits intomainfrom
Feature/populate-materailized-view
Feb 24, 2026
Merged

Feature/populate materailized view#103
lpi-tn merged 5 commits intomainfrom
Feature/populate-materailized-view

Conversation

@lpi-tn
Copy link
Collaborator

@lpi-tn lpi-tn commented Feb 20, 2026

This pull request introduces a new workflow for updating PostgreSQL materialized views in a Kubernetes environment using Argo Workflows. It adds a reusable workflow template and a supporting shell script to automate the refresh process for multiple materialized views, and schedules this operation to run every three hours.

Argo Workflow and CronWorkflow for Materialized Views:

  • Added updateMaterializedViews/workflow-template.yaml defining an Argo WorkflowTemplate and a CronWorkflow to automate the refresh of three materialized views (qty_document_in_qdrant, qty_document_in_qdrant_per_corpus, and qty_document_per_corpus) every three hours. The workflow uses a parameterized template to call a script for each view and includes security context and secret handling.

Script for Refreshing Materialized Views:

  • Introduced script/update-materialized-view, a Bash script that receives a materialized view name as an argument and refreshes it in PostgreSQL using credentials provided via environment variables. The script includes error handling and outputs status messages for observability.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Argo-based mechanism to periodically refresh PostgreSQL materialized views in the Kubernetes “welearn-datastack” deployment, backed by a reusable refresh script.

Changes:

  • Added a Bash script to refresh a specified PostgreSQL materialized view.
  • Added an Argo WorkflowTemplate to refresh three specific materialized views.
  • Added an Argo CronWorkflow to run the refresh workflow every 3 hours.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
script/update-materialized-view New Bash helper to run REFRESH MATERIALIZED VIEW CONCURRENTLY using env-provided DB credentials.
k8s/welearn-datastack/templates/updateMaterializedViews/workflow-template.yaml New Argo WorkflowTemplate + CronWorkflow to execute the refresh script for multiple views on a schedule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lpi-tn and others added 2 commits February 20, 2026 16:38
…ow-template.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lpi-tn lpi-tn merged commit 7ac50f5 into main Feb 24, 2026
7 checks passed
@lpi-tn lpi-tn deleted the Feature/populate-materailized-view branch February 24, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants